package cn.iocoder.yudao.module.blog.dal.mysql.improvemanager;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.blog.dal.dataobject.improvemanager.BlogImproveManagerDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.blog.controller.admin.improvemanager.vo.*;

/**
 * 课程权限 Mapper
 *
 * @author 曹建伟
 */
@Mapper
public interface BlogImproveManagerMapper extends BaseMapperX<BlogImproveManagerDO> {

    default PageResult<BlogImproveManagerDO> selectPage(BlogImproveManagerPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BlogImproveManagerDO>()
                .eqIfPresent(BlogImproveManagerDO::getImproveId, reqVO.getImproveId())
                .eqIfPresent(BlogImproveManagerDO::getMemberId, reqVO.getMemberId())
                .betweenIfPresent(BlogImproveManagerDO::getOvertime, reqVO.getOvertime())
                .betweenIfPresent(BlogImproveManagerDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(BlogImproveManagerDO::getId));
    }

    default List<BlogImproveManagerDO> selectList(BlogImproveManagerExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<BlogImproveManagerDO>()
                .eqIfPresent(BlogImproveManagerDO::getImproveId, reqVO.getImproveId())
                .eqIfPresent(BlogImproveManagerDO::getMemberId, reqVO.getMemberId())
                .betweenIfPresent(BlogImproveManagerDO::getOvertime, reqVO.getOvertime())
                .betweenIfPresent(BlogImproveManagerDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(BlogImproveManagerDO::getId));
    }

}
